﻿using System.Threading;

namespace Core
{
    public class TestThread : IThreadListener
    {
        public TestThread()
        {
            World.GetComponent<ThreadTaskComponent>().AddTask(this);
        }
        bool IThreadListener.OnAsyncTask()
        {
            Log.Debug($"OnAsyncTask: {Thread.CurrentThread.ManagedThreadId}");
            return true;
        }

        bool IThreadListener.OnSyncTask()
        {
            Log.Debug($"OnSyncTask: {Thread.CurrentThread.ManagedThreadId}");
            return true;
        }
        public void OnFinally()
        {
            Log.Debug($"OnFinally: {Thread.CurrentThread.ManagedThreadId}");
        }
    }
}